package twelve.decorator.example;

import java.io.UnsupportedEncodingException;

public abstract class Display {
    public abstract int getColumns() throws UnsupportedEncodingException;//获取横向字符数
    public abstract int getRows();//获取纵向行数
    public abstract String getRowText(int row) throws UnsupportedEncodingException;//获取第row行的字符串
    public final void show() throws UnsupportedEncodingException {
        for (int i=0;i < getRows(); i++){
            System.out.println(getRowText(i));
        }
    }

}
